cmake_minimum_required(VERSION 3.10)  # 建议使用至少3.10版本，以便利用更多特性

project(chat)  # 明确指定使用的语言为 C++


# set(CMAKE_CXX_STANDARD 17)
# set(CMAKE_CXX_STANDARD_REQUIRED ON)

# # 明确设置 C++ 编译器
# set(CMAKE_CXX_COMPILER "/usr/bin/g++")

# 配置编译选项
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -g)

# # 设置构建类型（如果未指定） 来代替上面CMAKE_CXX_FLAGS
# if(NOT CMAKE_BUILD_TYPE)
#     set(CMAKE_BUILD_TYPE Debug) # 或者 "Release"
# endif()

# 配置最终的可执行文件输出路径
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin)

# 定义一个包含所有头文件路径的列表
set(HEADER_DIRS
    ${PROJECT_SOURCE_DIR}/include
    ${PROJECT_SOURCE_DIR}/include/server
    ${PROJECT_SOURCE_DIR}/include/server/db
    ${PROJECT_SOURCE_DIR}/include/server/model
    ${PROJECT_BINARY_DIR}/include/server/redis
    ${PROJECT_SOURCE_DIR}/thirdparty    
    # ${PROJECT_SOURCE_DIR}/include/client
    )

# 向编译器指定额外的头文件搜索路径
include_directories(${HEADER_DIRS})

# 加载子目录 'src'
add_subdirectory(src)